package com.controller.setting;

import com.comm.R;
import com.service.setting.SysDutyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/setting/doctorManage")
@RestController
@Api(value = "职务管理test",tags = "职务管理接口API")
public class   SysDutyController {

    @Autowired
    private SysDutyService sysDutyService;

    //职务管理按钮
    @RequestMapping(value = ("/findDutyList"),method = RequestMethod.GET)
    @ApiOperation(value = "查询职务信息接口",notes = "显示职务信息",httpMethod = "get", response = R.class)
    public R findDuty(){
        R r = sysDutyService.findDutyList();
        return  r;
    }

    //查看权限按钮
    @RequestMapping(value = ("/findMenuByRoleId"),method = RequestMethod.GET)
    @ApiOperation(value = "查询权限信息接口",notes = "根据角色id查看所拥有权限",httpMethod = "get", response = R.class)
    @ApiImplicitParam(name = "id",value = "角色id",required = true,dataType = "int",paramType = "query")
    public R findMenuByRoleName(@RequestParam(name = "id")Integer id){

        R r = sysDutyService.findMenuByRoleId(id);
        return  r;
    }


}
